<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <input type="text" class="ss">
  <input type="text" class="aa">
  <button>登入</button>
  <ul>

  </ul>
  <script src="./axios.js"></script>
  <script>
    const ss = document.querySelector('.ss');
    const aa = document.querySelector('.aa');
    const btn = document.querySelector('button');
    const ul = document.querySelector('ul');
    btn.addEventListener('click', function(){
      const pname = ss.value
      const cname = aa.value
axios.get('http://ajax-api.itheima.net/api/area',{params:{pname, cname}})
.then(({data:res}) => {
  const {data} = res
ul.innerHTML = data.map(item => {
  return `<li>${item}</li>`
}).join('')


})



    })
  </script>
</body>
</html>